<mat-card>
  <mat-toolbar-row>
    <div class="toolbar-row-title">
      <a [ixTest]="['iscsi-share', 'open-in-new']" [routerLink]="['/sharing', 'iscsi', 'targets']">
        <h3
          class="card-title"
          [matTooltip]="'Block (iSCSI/Fibre Channel) Shares Targets' | translate"
          [matTooltipDisabled]="!hasFibreChannel()"
        >
          @if (hasFibreChannel()) {
            {{ 'Block (iSCSI/FC) Shares Targets' | translate }}
          } @else {
            {{ 'Block (iSCSI) Shares Targets' | translate }}
          }
          <ix-icon name="open_in_new" class="title-icon"></ix-icon>
        </h3>
      </a>

      <ix-service-state-button
        [service]="service$ | async"
        [count]="+(dataProvider.currentPageCount$ | async)"
      ></ix-service-state-button>
    </div>

    <div class="actions">
      <button
        *ixRequiresRoles="requiredRoles"
        mat-button
        [ixTest]="['iscsi-share', 'wizard']"
        [ixUiSearch]="searchableElements.elements.wizard"
        (click)="openForm(undefined, true)"
      >
        {{ 'Wizard' | translate }}
      </button>

      <ix-service-extra-actions
        [service]="service$ | async"
        [requiredRoles]="requiredRoles"
      ></ix-service-extra-actions>
    </div>
  </mat-toolbar-row>

  @if (!(dataProvider.currentPageCount$ | async) && !(dataProvider.isLoading$ | async)) {
    <ix-empty [conf]="emptyConfig"></ix-empty>
  } @else {
    <ix-table
      class="table"
      [ix-table-empty]="!(dataProvider.currentPageCount$ | async)"
      [emptyConfig]="emptyService.defaultEmptyConfig(dataProvider.emptyType$ | async)"
    >
      <thead
        ix-table-head
        [columns]="columns"
        [dataProvider]="dataProvider"
      ></thead>
      <tbody
        ix-table-body
        [columns]="columns"
        [dataProvider]="dataProvider"
        [isLoading]="!!(dataProvider.isLoading$ | async)"
      ></tbody>
    </ix-table>
  }

  <ix-table-pager-show-more
    [pageSize]="4"
    [dataProvider]="dataProvider"
    [ixTestOverride]="['iscsi']"
    [routerLink]="['/sharing', 'iscsi', 'targets']"
  ></ix-table-pager-show-more>
</mat-card>
